//store/modules/data_store.js
import {getData, deleteData, addDataByID} from "../../assets/utils/tree";
export default {
    state:{
        data:{},
        node:[]
    },
    mutations:{
        set_data(state,data){
            state.data=data
        },
        //点击节点展示下一级子节点
        getNodesData(state, data) {
            getData(state.data, data)
        },
        //删除子节点
        delData(state, id) {
            deleteData(state.data, id)
        },
        //添加子节点
        addData(state, id, dataTemplate) {
            addDataByID(state.data ,id, dataTemplate)
        }
    }
}
